﻿Imports MpqReader

Public Class MPQ

    Public Structure FileListEntry
        Dim Archive As String
        Dim Path As String
        Dim Size As Integer
    End Structure

    Public FileList As New System.Collections.Generic.Dictionary(Of String, FileListEntry)

    Public Sub PopulateFileList(ByVal Path As String)
        Dim Archive As MpqArchive = New MpqArchive(My.Settings.MPQList(0))
        For j As Integer = 0 To Archive.Files.Length - 1
            Dim a As FileListEntry
            a.Archive = My.Settings.MPQList(0)
            a.Size = Archive.Files(j).UncompressedSize
            a.Path = Archive.Files(j).Name.ToLower

            If a.Path.Contains(".m2") Then
                FileList(a.Path) = a
            End If
        Next
        Archive.Dispose()
    End Sub

End Class
